package com.lidong.lowcode.database.entity.database;

import com.lidong.lowcode.database.constants.enumconst.StrCaseEnum;
import com.lidong.lowcode.database.constants.database.CharacterSetEnum;
import com.lidong.lowcode.database.constants.database.EngineEnum;
import com.lidong.lowcode.database.constants.database.TableOrderEnum;

import java.util.List;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 9/10/2022 10:51 AM
 */
public class DataBaseTable  {

    /**
     * 数据库名
     */
    private String tableSchema;
    /**
     * 表名
     */
    private String tableName;
    /**
     * 表名大小写
     */
    private StrCaseEnum tableNameCase;
    /**
     * 表引擎
     */
    private EngineEnum tableEngine;
    /**
     * 表自增开始数
     */
    private int autoIncrementNum;
    /**
     * 表字符集
     */
    private CharacterSetEnum character;
    /**
     * 表排序
     */
    private TableOrderEnum orderType;
    /**
     * 表备注
     */
    private String remark;

    /**
     * 表字段
     */
    private List<DataBaseColumn> dataBaseColumnList;

    /**
     * 表主键
     */
    private DataBasePrimaryKey dataBasePrimaryKey;

    /**
     * 表外键
     */
    private List<DataBaseForeignKey> dataBaseForeignKeyList;

    /**
     * 表索引
     */
    private List<DataBaseIndex> dataBaseIndexList;

    /**
     * 表唯一索引
     */
    private List<DataBaseUniqueKey> dataBaseUniqueKeyList;

    /**
     * 表名时间戳
     */
    private String nameTimeSuffix;

    /**
     * 新增或者修改
     */
    private String createOrUpdateTime;

    /**
     * 表的版本记录时间戳
     */
    private String version;

    public DataBaseTable(String name, String comment, StrCaseEnum strCaseEnum, int autoIncrementNum, TableOrderEnum tableOrderEnum, CharacterSetEnum characterSetEnum, EngineEnum engine) {
        tableName = name;
        remark = comment;
        tableNameCase = strCaseEnum;
        this.autoIncrementNum = autoIncrementNum;
        orderType = tableOrderEnum;
        character = characterSetEnum;
        tableEngine = engine;
    }

    public DataBaseTable() {

    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public StrCaseEnum getTableNameCase() {
        return tableNameCase;
    }

    public void setTableNameCase(StrCaseEnum tableNameCase) {
        this.tableNameCase = tableNameCase;
    }

    public EngineEnum getTableEngine() {
        return tableEngine;
    }

    public void setTableEngine(EngineEnum tableEngine) {
        this.tableEngine = tableEngine;
    }

    public int getAutoIncrementNum() {
        return autoIncrementNum;
    }

    public void setAutoIncrementNum(int autoIncrementNum) {
        this.autoIncrementNum = autoIncrementNum;
    }

    public CharacterSetEnum getCharacter() {
        return character;
    }

    public void setCharacter(CharacterSetEnum character) {
        this.character = character;
    }

    public TableOrderEnum getOrderType() {
        return orderType;
    }

    public void setOrderType(TableOrderEnum orderType) {
        this.orderType = orderType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<DataBaseColumn> getColumnList() {
        return dataBaseColumnList;
    }

    public void setColumnList(List<DataBaseColumn> dataBaseColumnList) {
        this.dataBaseColumnList = dataBaseColumnList;
    }

    public DataBasePrimaryKey getPrimaryKey() {
        return dataBasePrimaryKey;
    }

    public void setPrimaryKey(DataBasePrimaryKey dataBasePrimaryKey) {
        this.dataBasePrimaryKey = dataBasePrimaryKey;
    }

    public List<DataBaseForeignKey> getForeignKeyList() {
        return dataBaseForeignKeyList;
    }

    public void setForeignKeyList(List<DataBaseForeignKey> dataBaseForeignKeyList) {
        this.dataBaseForeignKeyList = dataBaseForeignKeyList;
    }

    public List<DataBaseIndex> getIndexList() {
        return dataBaseIndexList;
    }

    public void setIndexList(List<DataBaseIndex> dataBaseIndexList) {
        this.dataBaseIndexList = dataBaseIndexList;
    }

    public List<DataBaseUniqueKey> getUniqueKeyList() {
        return dataBaseUniqueKeyList;
    }

    public void setUniqueKeyList(List<DataBaseUniqueKey> dataBaseUniqueKeyList) {
        this.dataBaseUniqueKeyList = dataBaseUniqueKeyList;
    }

    public List<DataBaseColumn> getDataBaseColumnList() {
        return dataBaseColumnList;
    }

    public void setDataBaseColumnList(List<DataBaseColumn> dataBaseColumnList) {
        this.dataBaseColumnList = dataBaseColumnList;
    }

    public DataBasePrimaryKey getDataBasePrimaryKey() {
        return dataBasePrimaryKey;
    }

    public void setDataBasePrimaryKey(DataBasePrimaryKey dataBasePrimaryKey) {
        this.dataBasePrimaryKey = dataBasePrimaryKey;
    }

    public List<DataBaseForeignKey> getDataBaseForeignKeyList() {
        return dataBaseForeignKeyList;
    }

    public void setDataBaseForeignKeyList(List<DataBaseForeignKey> dataBaseForeignKeyList) {
        this.dataBaseForeignKeyList = dataBaseForeignKeyList;
    }

    public List<DataBaseIndex> getDataBaseIndexList() {
        return dataBaseIndexList;
    }

    public void setDataBaseIndexList(List<DataBaseIndex> dataBaseIndexList) {
        this.dataBaseIndexList = dataBaseIndexList;
    }

    public List<DataBaseUniqueKey> getDataBaseUniqueKeyList() {
        return dataBaseUniqueKeyList;
    }

    public void setDataBaseUniqueKeyList(List<DataBaseUniqueKey> dataBaseUniqueKeyList) {
        this.dataBaseUniqueKeyList = dataBaseUniqueKeyList;
    }

    public String getNameTimeSuffix() {
        return nameTimeSuffix;
    }

    public void setNameTimeSuffix(String nameTimeSuffix) {
        this.nameTimeSuffix = nameTimeSuffix;
    }

    public String getCreateOrUpdateTime() {
        return createOrUpdateTime;
    }

    public void setCreateOrUpdateTime(String createOrUpdateTime) {
        this.createOrUpdateTime = createOrUpdateTime;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getTableSchema() {
        return tableSchema;
    }

    public void setTableSchema(String tableSchema) {
        this.tableSchema = tableSchema;
    }

    @Override
    public String toString() {
        return "DataBaseTable{" +
                "tableName='" + tableName + '\'' +
                ", tableNameCase=" + tableNameCase +
                ", tableEngine=" + tableEngine +
                ", autoIncrementNum=" + autoIncrementNum +
                ", character=" + character +
                ", orderType=" + orderType +
                ", remark='" + remark + '\'' +
                ", dataBaseColumnList=" + dataBaseColumnList +
                ", dataBasePrimaryKey=" + dataBasePrimaryKey +
                ", dataBaseForeignKeyList=" + dataBaseForeignKeyList +
                ", dataBaseIndexList=" + dataBaseIndexList +
                ", dataBaseUniqueKeyList=" + dataBaseUniqueKeyList +
                ", nameTimeSuffix='" + nameTimeSuffix + '\'' +
                ", createOrUpdateTime='" + createOrUpdateTime + '\'' +
                ", version='" + version + '\'' +
                '}';
    }
}
